package com.itheima.service.impl;

import com.itheima.entity.MedicalRecord;
import com.itheima.mapper.MedicalRecordMapper;
import com.itheima.service.MedicalRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MedicalRecordServiceImpl implements MedicalRecordService {

    @Autowired
    private MedicalRecordMapper medicalRecordMapper;


    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public List<MedicalRecord> findAll() {
        return medicalRecordMapper.findAll();
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public MedicalRecord findById(Integer id) {
        return medicalRecordMapper.findById(id);
    }
}
